using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.InteropServices;

using ILRuntime.CLR.TypeSystem;
using ILRuntime.CLR.Method;
using ILRuntime.Runtime.Enviorment;
using ILRuntime.Runtime.Intepreter;
using ILRuntime.Runtime.Stack;
using ILRuntime.Reflection;
using ILRuntime.CLR.Utils;
using System.Linq;

namespace ILRuntime.Runtime.Generated
{
    unsafe class FrameManager_Binding
    {
        public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
        {
            BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
            MethodBase method;
            FieldInfo field;
            Type[] args;
            Type type = typeof(global::FrameManager);
            args = new Type[]{};
            method = type.GetMethod("get_AverageCpuFrameTime", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, get_AverageCpuFrameTime_0);
            args = new Type[]{};
            method = type.GetMethod("get_AverageGpuFrameTime", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, get_AverageGpuFrameTime_1);
            args = new Type[]{};
            method = type.GetMethod("get_AverageFPS", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, get_AverageFPS_2);
            args = new Type[]{};
            method = type.GetMethod("get_AverageGpuFPS", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, get_AverageGpuFPS_3);
            args = new Type[]{};
            method = type.GetMethod("get_CurrentFPS", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, get_CurrentFPS_4);
            args = new Type[]{typeof(System.UInt32)};
            method = type.GetMethod("set_maxNumFrames", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, set_maxNumFrames_5);
            args = new Type[]{};
            method = type.GetMethod("get_AllowDynamicResolution", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, get_AllowDynamicResolution_6);

            field = type.GetField("StateChanged", flag);
            app.RegisterCLRFieldGetter(field, get_StateChanged_0);
            app.RegisterCLRFieldSetter(field, set_StateChanged_0);
            app.RegisterCLRFieldBinding(field, CopyToStack_StateChanged_0, AssignFromStack_StateChanged_0);
            field = type.GetField("StatisticsPerTime", flag);
            app.RegisterCLRFieldGetter(field, get_StatisticsPerTime_1);
            app.RegisterCLRFieldSetter(field, set_StatisticsPerTime_1);
            app.RegisterCLRFieldBinding(field, CopyToStack_StatisticsPerTime_1, AssignFromStack_StatisticsPerTime_1);


            app.RegisterCLRCreateDefaultInstance(type, () => new global::FrameManager());
            app.RegisterCLRCreateArrayInstance(type, s => new global::FrameManager[s]);

            args = new Type[]{};
            method = type.GetConstructor(flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Ctor_0);

        }


        static StackObject* get_AverageCpuFrameTime_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            global::FrameManager instance_of_this_method = (global::FrameManager)typeof(global::FrameManager).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.AverageCpuFrameTime;

            __ret->ObjectType = ObjectTypes.Float;
            *(float*)&__ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static StackObject* get_AverageGpuFrameTime_1(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            global::FrameManager instance_of_this_method = (global::FrameManager)typeof(global::FrameManager).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.AverageGpuFrameTime;

            __ret->ObjectType = ObjectTypes.Float;
            *(float*)&__ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static StackObject* get_AverageFPS_2(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            global::FrameManager instance_of_this_method = (global::FrameManager)typeof(global::FrameManager).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.AverageFPS;

            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static StackObject* get_AverageGpuFPS_3(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            global::FrameManager instance_of_this_method = (global::FrameManager)typeof(global::FrameManager).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.AverageGpuFPS;

            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static StackObject* get_CurrentFPS_4(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            global::FrameManager instance_of_this_method = (global::FrameManager)typeof(global::FrameManager).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.CurrentFPS;

            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static StackObject* set_maxNumFrames_5(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.UInt32 @value = (uint)ptr_of_this_method->Value;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            global::FrameManager instance_of_this_method = (global::FrameManager)typeof(global::FrameManager).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.maxNumFrames = value;

            return __ret;
        }

        static StackObject* get_AllowDynamicResolution_6(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            global::FrameManager instance_of_this_method = (global::FrameManager)typeof(global::FrameManager).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.AllowDynamicResolution;

            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method ? 1 : 0;
            return __ret + 1;
        }


        static object get_StateChanged_0(ref object o)
        {
            return ((global::FrameManager)o).StateChanged;
        }

        static StackObject* CopyToStack_StateChanged_0(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((global::FrameManager)o).StateChanged;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_StateChanged_0(ref object o, object v)
        {
            ((global::FrameManager)o).StateChanged = (System.Action<global::FrameManager>)v;
        }

        static StackObject* AssignFromStack_StateChanged_0(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Action<global::FrameManager> @StateChanged = (System.Action<global::FrameManager>)typeof(System.Action<global::FrameManager>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)8);
            ((global::FrameManager)o).StateChanged = @StateChanged;
            return ptr_of_this_method;
        }

        static object get_StatisticsPerTime_1(ref object o)
        {
            return ((global::FrameManager)o).StatisticsPerTime;
        }

        static StackObject* CopyToStack_StatisticsPerTime_1(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((global::FrameManager)o).StatisticsPerTime;
            __ret->ObjectType = ObjectTypes.Float;
            *(float*)&__ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_StatisticsPerTime_1(ref object o, object v)
        {
            ((global::FrameManager)o).StatisticsPerTime = (System.Single)v;
        }

        static StackObject* AssignFromStack_StatisticsPerTime_1(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Single @StatisticsPerTime = *(float*)&ptr_of_this_method->Value;
            ((global::FrameManager)o).StatisticsPerTime = @StatisticsPerTime;
            return ptr_of_this_method;
        }



        static StackObject* Ctor_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* __ret = ILIntepreter.Minus(__esp, 0);

            var result_of_this_method = new global::FrameManager();

            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }


    }
}
